﻿
@{
    Layout = null;
}
@model  FangDuShi_Admin.Model.IPWhiteList
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>IPadd</title>

    <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css" />
    <!-- jQuery UI theme -->
    <link rel="stylesheet" href="/lib/jquery-ui/css/Aristo/Aristo.css" />
    <!-- tooltips-->
    <link rel="stylesheet" href="/lib/jBreadcrumbs/css/BreadCrumb.css" />
    <!-- tooltips-->
    <link rel="stylesheet" href="/lib/qtip2/jquery.qtip.min.css" />
    <!-- colorbox -->
    <link rel="stylesheet" href="/lib/colorbox/colorbox.css" />
    <!-- code prettify -->
    <link rel="stylesheet" href="/lib/google-code-prettify/prettify.css" />
    <!-- sticky notifications -->
    <link rel="stylesheet" href="/lib/sticky/sticky.css" />
    <!-- aditional icons -->
    <link rel="stylesheet" href="/img/splashy/splashy.css" />
    <!-- flags -->
    <link rel="stylesheet" href="/img/flags/flags.css" />
    <!-- datatables -->
    <link rel="stylesheet" href="/lib/datatables/extras/TableTools/media/css/TableTools.css">

    <!-- calendar -->
    <link rel="stylesheet" href="/lib/fullcalendar/fullcalendar_gebo.css" />

    <!-- main styles -->
    <link rel="stylesheet" href="/css/style.css" />
    <!-- theme color-->
    <link rel="stylesheet" href="/css/blue.css" id="link_theme" />

    <!--             <link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'> -->
    <!-- favicon -->
    <link rel="shortcut icon" href="favicon.ico" />

    <!--[if lte IE 8]>
        <link rel="stylesheet" href="css/ie.css" />
    <![endif]-->
    <!--[if lt IE 9]>
        <script src="js/ie/html5.js"></script>
        <script src="js/ie/respond.min.js"></script>
        <script src="/lib/flot/excanvas.min.js"></script>
    <![endif]-->
    <script src="/Scripts/jquery.min.js"></script>
    <script src="/Scripts/jquery-migrate.min.js"></script>
    <script src="/lib/jquery-ui/jquery-ui-1.10.0.custom.min.js"></script>
    <!-- touch events for jquery ui-->
    <script src="/Scripts/forms/jquery.ui.touch-punch.min.js"></script>
    <!-- easing plugin -->
    <script src="/Scripts/jquery.easing.1.3.min.js"></script>
    <!-- smart resize event -->
    <script src="/Scripts/jquery.debouncedresize.min.js"></script>
    <!-- js cookie plugin -->
    <script src="/Scripts/jquery_cookie_min.js"></script>
    <!-- main bootstrap js -->
    <script src="/bootstrap/js/bootstrap.min.js"></script>
    <!-- bootstrap plugins -->
    <script src="/Scripts/bootstrap.plugins.min.js"></script>
    <!-- typeahead -->
    <script src="/lib/typeahead/typeahead.min.js"></script>
    <!-- code prettifier -->
    <script src="/lib/google-code-prettify/prettify.min.js"></script>
    <!-- sticky messages -->
    <script src="/lib/sticky/sticky.min.js"></script>
    <!-- tooltips -->
    <script src="/lib/qtip2/jquery.qtip.min.js"></script>
    <!-- lightbox -->
    <script src="/lib/colorbox/jquery.colorbox.min.js"></script>
    <!-- jBreadcrumbs -->
    <script src="/lib/jBreadcrumbs/js/jquery.jBreadCrumb.1.1.min.js"></script>
    <!-- hidden elements width/height -->
    <script src="/Scripts/jquery.actual.min.js"></script>
    <!-- custom scrollbar -->
    <script src="/lib/slimScroll/jquery.slimscroll.js"></script>
    <!-- fix for ios orientation change -->
    <script src="/Scripts/ios-orientationchange-fix.js"></script>
    <!-- to top -->
    <script src="/lib/UItoTop/jquery.ui.totop.min.js"></script>
    <!-- mobile nav -->
    <script src="/Scripts/selectNav.js"></script>
    <!-- common functions -->
    <!--	<script src="js/gebo_common.js"></script>-->

    <script src="/lib/datatables/jquery.dataTables.min.js"></script>
    <script src="/lib/datatables/extras/Scroller/media/js/dataTables.scroller.min.js"></script>
    <!-- datatable table tools -->
    <script src="/lib/datatables/extras/TableTools/media/js/TableTools.min.js"></script>
    <script src="/lib/datatables/extras/TableTools/media/js/ZeroClipboard.js"></script>
    <!-- datatables bootstrap integration -->
    <script src="/lib/datatables/jquery.dataTables.bootstrap.min.js"></script>

    <!-- datatable functions -->
    <script src="/Scripts/gebo_datatables.js"></script>

    <script type="text/javascript" >

        $(document).ready(function () {

            InitLimit($("#fck1"), 192, true, function (c) {
                if (c >= 0) {
                    $("#inputedWord").text("还能输入" + c + "个字");
                } else {
                    $("#inputedWord").text("已经超过" + (-c) + "个字");
                }
            });
        });
        function save() {


            $.ajax({
                type: "POST",
                url: '@Url.Action("Save", "IPWhiteList")',
                data: $('#form1').serialize(),
                error: function (data) {
                    alert(data);
                },
                success: function (data) {
                    alert(data);

                    if (data == "操作成功") {
                      

                        parent.codeOK();
                    }
                }
            });
            // form1.submit();
        }
            function InitLimit(txt, limit, isbyte, cb) {
                txt.keyup(function () {
                    var str = txt.val();
                    var charLen;
                    var byteLen = 0;
                    if (isbyte) {//原文博客：blog.csdn.net/bluceyoung   
                        for (var i = 0; i < str.length; i++) {
                            if (str.charCodeAt(i) > 255) {
                                byteLen += 1;
                            } else {
                                byteLen++;
                            }
                        }
                        charLen = Math.floor((limit - byteLen));
                    } else {
                        byteLen = str.length;
                        charLen = limit - byteLen;
                    }
                    cb(charLen);
                });
            }
    </script>
</head>
<body>
    <div class="container">


        <div class="row">
            <div class="col-sm-offset-1 col-sm-10">


                <form class="form-horizontal" role="form" id="form1" name="form1">
                    <div class="form-group">

                        <label class="col-xs-3 control-label input-sm text-right"> 起始IP地址:</label>
                        <div class="col-xs-8 ">
                            <input type="text" value="@Model.FStartIPStr" id="startip" name="startip" class="form-control  input-sm" placeholder=" ">
                        </div>

                    </div>
                    <div class="form-group ">
                        <label class="col-xs-3 control-label input-sm text-right">结束IP地址:</label>
                        <div class="col-xs-8 ">
                            <input type="text"  value="@Model.FEndIPStr" id="endip" name="endip" class="form-control  input-sm" placeholder=" ">
                        </div>
                    </div>
                    <div class="form-group ">
                        <label class="col-xs-3 control-label input-sm text-right">备注说明:</label>
                        <div class="col-xs-8">
                            <textarea name="fck1"  name="fck1" class="form-control" id="fck1" rows="10" cols="10">@Model.FNote</textarea>
                        </div>
                    </div>
                    <div class="form-group ">
                        <div class="col-xs-12 text-center">
                            <span id="inputedWord" style="color: red; width: auto; text-align: left;"></span>
                        </div>
                    </div>
                    @Html.Hidden("hdMethod", ViewData["hdMethod"])
                    @Html.Hidden("hFID", Model.FID)
                </form>
            </div>
        </div>
    </div>
</body>
</html>
